//ybzuo
#pragma once
#include "road_node.h"
#include <vector>
#include "Screen/base_image.h"
#include "Screen/quick_text.h"


typedef struct NODE_MAP_PLAYER
{
	HOBJECT m_obj;
	std::string m_name;
	int m_current_node;
	base_image m_map_bmp;

	NODE_MAP_PLAYER():
	m_obj(0),m_name(""),m_current_node(0)
	{
	
	}

};
class road_node_map
{
public:
	static road_node_map& single()
	{
		static road_node_map _single;
	    return _single;
   }
	~road_node_map();
	void load_road_info(const char* _filename);
	void draw();
	void debug_render();
	void relocation();
	void location();
	void set_window_size(float _w,float _h)
	{m_window_w=_w;m_window_h=_h;};
	void add_player(HOBJECT _obj,const std::string& _name);
private:
	static const int m_show_nodes=200;
	road_node_map();
	std::vector<road_node> m_nodes;
	road_node m_current_node;
	uint m_node_index;
	HOBJECT m_car;
	HTEXTURE m_tex;
	base_image m_map_elements_f[m_show_nodes]; 
	base_image m_map_elements_b[m_show_nodes]; 
	base_image m_map_back;
	base_image m_map_self;
	

	float  m_map_height;
	float  m_map_wide;
	float  m_map_pos_x;
	float  m_map_pos_y;



	float m_degree;


	LTVector m_temp_vec[m_show_nodes];


	LT_POLYFT4 m_temp_poly[m_show_nodes*2];


	quick_text  m_rounds;

	float m_window_w;
	float m_window_h;


	int m_other_players_num;


	static const int m_max_players=3;
	NODE_MAP_PLAYER m_players[m_max_players];

	

	

};